home *** CD-ROM | disk | FTP | other *** search
/ Komputer for Alle 2004 #2 / K-CD-2-2004.ISO / OpenOffice Sv / f_0397 / python-core-2.2.2 / lib / test / test_mimetools.py < prev    next >
Encoding:
Python Source  |  2003-07-18  |  502 b   |  19 lines

  1. from test_support import TestFailed
  2. import mimetools
  3.  
  4. import string,StringIO
  5. start = string.ascii_letters + "=" + string.digits + "\n"
  6. for enc in ['7bit','8bit','base64','quoted-printable']:
  7.     print enc,
  8.     i = StringIO.StringIO(start)
  9.     o = StringIO.StringIO()
  10.     mimetools.encode(i,o,enc)
  11.     i = StringIO.StringIO(o.getvalue())
  12.     o = StringIO.StringIO()
  13.     mimetools.decode(i,o,enc)
  14.     if o.getvalue()==start:
  15.         print "PASS"
  16.     else:
  17.         print "FAIL"
  18.         print o.getvalue()
  19.